#pragma once
#include "World.h"
#include "NeuralNet.h"
#include <vector>

struct Leg
{
	GameObject* obj0;
	GameObject* obj1;
	btGeneric6DofConstraint* joint0;
	btGeneric6DofConstraint* joint1;	
};


class Robot
{
public:
	Robot(World* world);
	float* getNeuralWeights();
	size_t getNeuralWeightsCount() const;
	void update();
	btRigidBody* getBody(){return body->body;}
	std::vector<GameObject*> objects;
private:
	void updateJoint(btGeneric6DofConstraint* joint, int index, float v);
	void createBody();
	Leg createLeg(GameObject* body, const btVector3& offset);
	void createWheel(GameObject* body, const btVector3& offset);
	void createNet();
	std::vector<btGeneric6DofConstraint*> joints3Dof;
	std::vector<btGeneric6DofConstraint*> joints1Dof;
	World* world;
	GameObject* body;
	std::auto_ptr<NeuralNet> net;

};
